 package tools.packet;

 import client.MapleCharacter;
 import handling.opcode.SendPacketOpcode;
 import java.util.List;
 import server.carnival.MapleCarnivalParty;
 import tools.data.output.MaplePacketLittleEndianWriter;























 public class MonsterCarnivalPacket
 {
   public static byte[] startMonsterCarnival(MapleCharacter chr, int enemyavailable, int enemytotal) {
/*  34 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/*  36 */     mplew.writeShort(SendPacketOpcode.MONSTER_CARNIVAL_START.getValue());
/*  37 */     MapleCarnivalParty friendly = chr.getCarnivalParty();
/*  38 */     mplew.write(friendly.getTeam());
/*  39 */     mplew.writeInt(chr.getAvailableCP());
/*  40 */     mplew.writeInt(chr.getTotalCP());
/*  41 */     mplew.writeInt(friendly.getAvailableCP());
/*  42 */     mplew.writeInt(friendly.getTotalCP());
/*  43 */     mplew.write(0);

/*  45 */     return mplew.getPacket();
   }

   public static byte[] playerDiedMessage(String name, int lostCP, int team) {
/*  49 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/*  51 */     mplew.writeShort(SendPacketOpcode.MONSTER_CARNIVAL_DIED.getValue());
/*  52 */     mplew.write(team);
/*  53 */     mplew.writeMapleAsciiString(name);
/*  54 */     mplew.write(lostCP);

/*  56 */     return mplew.getPacket();
   }

   public static byte[] playerLeaveMessage(boolean leader, String name, int team) {
/*  60 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/*  62 */     mplew.writeShort(SendPacketOpcode.MONSTER_CARNIVAL_LEAVE.getValue());
/*  63 */     mplew.write(leader ? 7 : 0);
/*  64 */     mplew.write(team);
/*  65 */     mplew.writeMapleAsciiString(name);

/*  67 */     return mplew.getPacket();
   }

   public static byte[] CPUpdate(boolean party, int curCP, int totalCP, int team) {
/*  71 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/*  73 */     mplew.writeShort(SendPacketOpcode.MONSTER_CARNIVAL_OBTAINED_CP.getValue());
/*  74 */     mplew.writeInt(curCP);
/*  75 */     mplew.writeInt(totalCP);

/*  77 */     return mplew.getPacket();
   }

   public static byte[] showMCStats(int left, int right) {
/*  81 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/*  83 */     mplew.writeShort(SendPacketOpcode.MONSTER_CARNIVAL_STATS.getValue());
/*  84 */     mplew.writeInt(left);
/*  85 */     mplew.writeInt(right);

/*  87 */     return mplew.getPacket();
   }

   public static byte[] playerSummoned(String name, int tab, int number) {
/*  91 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/*  93 */     mplew.writeShort(SendPacketOpcode.MONSTER_CARNIVAL_SUMMON.getValue());
/*  94 */     mplew.write(tab);
/*  95 */     mplew.write(number);
/*  96 */     mplew.writeMapleAsciiString(name);

/*  98 */     return mplew.getPacket();
   }

   public static byte[] showMCResult(int mode) {
/* 102 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 104 */     mplew.writeShort(SendPacketOpcode.MONSTER_CARNIVAL_RESULT.getValue());
/* 105 */     mplew.write(mode);

/* 107 */     return mplew.getPacket();
   }

   public static byte[] showMCRanking(List<MapleCharacter> players) {
/* 111 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 113 */     mplew.writeShort(SendPacketOpcode.MONSTER_CARNIVAL_RANKING.getValue());
/* 114 */     mplew.writeShort(players.size());
/* 115 */     for (MapleCharacter i : players) {
/* 116 */       mplew.writeInt(i.getId());
/* 117 */       mplew.writeMapleAsciiString(i.getName());
/* 118 */       mplew.writeInt(10);
/* 119 */       mplew.write(0);
     }

/* 122 */     return mplew.getPacket();
   }

   public static byte[] startCPQ(byte team, int usedcp, int totalcp) {
/* 126 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/* 127 */     mplew.writeShort(SendPacketOpcode.MONSTER_CARNIVAL_START.getValue());
/* 128 */     mplew.write(0);
/* 129 */     mplew.writeShort(0);
/* 130 */     mplew.writeShort(0);
/* 131 */     mplew.writeShort(0);
/* 132 */     mplew.writeShort(0);
/* 133 */     mplew.writeShort(0);
/* 134 */     mplew.writeShort(0);
/* 135 */     mplew.writeShort(0);
/* 136 */     mplew.writeLong(0L);
/* 137 */     return mplew.getPacket();
   }

   public static byte[] obtainCP() {
/* 141 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/* 142 */     mplew.writeShort(SendPacketOpcode.MONSTER_CARNIVAL_OBTAINED_CP.getValue());
/* 143 */     mplew.writeShort(0);
/* 144 */     mplew.writeShort(0);
/* 145 */     return mplew.getPacket();
   }

   public static byte[] obtainPartyCP() {
/* 149 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 151 */     mplew.write(0);
/* 152 */     mplew.writeShort(0);
/* 153 */     mplew.writeShort(0);
/* 154 */     return mplew.getPacket();
   }

   public static byte[] CPQSummon() {
/* 158 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/* 159 */     mplew.writeShort(SendPacketOpcode.MONSTER_CARNIVAL_SUMMON.getValue());
/* 160 */     mplew.write(0);
/* 161 */     mplew.write(0);
/* 162 */     mplew.writeMapleAsciiString("");
/* 163 */     return mplew.getPacket();
   }

   public static byte[] CPQDied() {
/* 167 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/* 168 */     mplew.writeShort(SendPacketOpcode.MONSTER_CARNIVAL_SUMMON.getValue());
/* 169 */     mplew.write(0);
/* 170 */     mplew.writeMapleAsciiString("");
/* 171 */     mplew.write(0);
/* 172 */     return mplew.getPacket();
   }












   public static byte[] CPQMessage(byte message) {
/* 187 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/* 188 */     mplew.writeShort(SendPacketOpcode.MONSTER_CARNIVAL_MESSAGE.getValue());
/* 189 */     mplew.write(message);
/* 190 */     return mplew.getPacket();
   }

   public static byte[] leaveCPQ() {
/* 194 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/* 195 */     mplew.writeShort(SendPacketOpcode.MONSTER_CARNIVAL_LEAVE.getValue());
/* 196 */     mplew.write(0);
/* 197 */     mplew.write(0);
/* 198 */     mplew.writeMapleAsciiString("");
/* 199 */     return mplew.getPacket();
   }
 }


/* Location:              C:\PGX\Server.jar!\tools\packet\MonsterCarnivalPacket.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */